package com.szq.pattern.user;

import com.szq.pattern.visitor.Visitor;

import java.math.BigDecimal;

/**
 * @description:
 * @author: szq
 * @date: 2021-09-11 08:50:40
 */
public class Teacher extends User {


    public Teacher(String name, String identity, String clazz) {
        super(name, identity, clazz);
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }

    //升学率
    public double entranceRatio(){
        return BigDecimal.valueOf(Math.random() * 100).setScale(2, BigDecimal.ROUND_UP).doubleValue();
    }
}
